    <template>
  <div>
    <div class="head">
      <i class="iconfont icon-left"
         @click="change()"></i>
      <div class="person-center">{{pro}}</div>
      <i class="iconfont icon-sevice"></i>
      <i class="iconfont icon-menuunfold"
         @click="display()"></i>
      <ul class="nav"
          v-show="isActive">
        <li>
          <router-link to="/showss"
                       :class="'nav-link'">
            <i class="iconfont icon-sanguohome"></i>
            <span>首页</span>
          </router-link>
        </li>
        <li>
          <router-link to="/typess"
                       :class="'nav-link'">
            <i class="iconfont icon-icon04"></i>
            <span>分类搜索</span>
          </router-link>
        </li>
        <li>
          <router-link to="/shopcarss"
                       :class="'nav-link'">
            <i class="iconfont icon-shop-cart-"></i>
            <span>购物车</span>
          </router-link>
        </li>
        <li>
          <router-link to="/myss"
                       :class="'nav-link'">
            <i class="iconfont icon-i-smile"></i>
            <span>我的</span>
          </router-link>
        </li>
      </ul>
    </div>

     <div class="main-aside">
        <mt-navbar v-model="selected">
          <mt-tab-item id="1">综合</mt-tab-item>
          <mt-tab-item id="2">销量</mt-tab-item>
          <mt-tab-item id="3">价格</mt-tab-item>
          <mt-tab-item id="4">新品</mt-tab-item>
        </mt-navbar>
      </div>
    <div>
        <mt-tab-container v-model="selected">
          <mt-tab-container-item id="1">
            <total :total="flower.forever1" :prop="prop" v-show="pro==xh"></total>
            <total :total="forFlower.foreverflower1" v-show="pro==ysh"></total>
            <total :total="cake.cake1" v-show="pro==dg"></total>
            <total :total="gift.present1" v-show="pro==lp"></total>
            <total :total="chocolate.chocolate1" v-show="pro==qkl"></total>
          </mt-tab-container-item>
          <mt-tab-container-item id="2">
            <total :total="flower.forever1" :prop="prop" v-show="pro==xh"></total>
            <total :total="forFlower.foreverflower1" v-show="pro==ysh"></total>
            <total :total="cake.cake1" v-show="pro==dg"></total>
            <total :total="gift.present1" v-show="pro==lp"></total>
            <total :total="chocolate.chocolate1" v-show="pro==qkl"></total>

          </mt-tab-container-item>
          <mt-tab-container-item id="3">
            <total :total="flower.forever1" :prop="prop" v-show="pro==xh"></total>
            <total :total="forFlower.foreverflower1" v-show="pro==ysh"></total>
            <total :total="cake.cake1" v-show="pro==dg"></total>
            <total :total="gift.present1" v-show="pro==lp"></total>
            <total :total="chocolate.chocolate1" v-show="pro==qkl"></total>

          </mt-tab-container-item>
          <mt-tab-container-item id="4">
            <total :total="flower.forever1" :prop="prop" v-show="pro==xh"></total>
            <total :total="forFlower.foreverflower1" v-show="pro==ysh"></total>
            <total :total="cake.cake1" v-show="pro==dg"></total>
            <total :total="gift.present1" v-show="pro==lp"></total>
            <total :total="chocolate.chocolate1" v-show="pro==qkl"></total>

          </mt-tab-container-item>
        </mt-tab-container>
    </div>
  </div>
</template>
<style lang="less" scoped>
.head {
  padding: 0px 20px;
  display: flex;
  justify-content: space-between;
  position: relative;
  .person-center {
    height: 3.14rem;
    line-height: 3.14285714rem;
    background: #fff;
    font-size: 1.14rem;
    text-align: center;
    line-height: 3.14rem;
    position: relative;
  }
  
  .iconfont {
    display: block;
    line-height: 3.14rem;
    font-size: 20px;
  }
  .icon-sevice{
    position: absolute;
    right: 15%;
    display: block;
   font-size: 24px;
   top: -1px;
  }
  .nav {
    position: absolute;
    background: white;
    right: 10px;
    top: 3rem;
    font-size: 14px;
    border: 1px solid #e9ecf0;
    border-radius: 0.286rem;
    box-shadow: 0 4px 12px 0 #e9ecf0;
    .iconfont {
      line-height: normal;
      display: inline-block;
      font-size: 1rem;
      margin-right: 0.4rem;
    }
    li {
      height: 3rem;
      line-height: 3rem;
      padding: 0rem 0.85rem;

      .nav-link {
        text-decoration: none;
        color: black;
      }
    }
    &:before {
      content: "";
      width: 6px;
      height: 6px;
      background: white;
      position: absolute;
      transform: rotate(45deg);
      border-left: 1px solid #e9ecf0;
      border-top: 1px solid #e9ecf0;
      top: -5px;
      right: 15px;
    }
  }
}


.main-aside{
  height: 3.14rem;
  line-height: 3.14rem;
  .mint-navbar{
    display: flex;
    justify-content: space-around;
    .is-selected{
      color:#ff734c;
    }
  }
}



</style>
<script>
import total from '../common/total.vue'
export default {
  components:{
      total
  },
  data () {
    return {
      msg: 1,
      isActive: false,
      pro:'',
      prop:{},
      selected: '1',
      flower:[],
      cake:[],
      xh:'鲜花',
      ysh:'永生花',
      dg:'蛋糕',
      lp:'礼品',
      qkl:'巧克力',
      forFlower:[],
      gift:[],
      chocolate:[]
    }

  },
  methods: {
    change () {
      this.$router.go(-1);
    },
    display () {
      this.isActive = !this.isActive
    }
  },
  mounted(){
    // console.log(this.$route.params)
    this.pro=this.$route.params.b;
    this.$http.get('./data/flower1-details.json').then(res=>{
       this.flower=res.data.forever;
       this.forFlower=res.data.foreverflower;
       this.gift=res.data.present;
       this.cake=res.data.cake;
       this.chocolate=res.data.chocolate;
      this.prop=res.data.forever.forever1[0].id
      // console.log(res.data.forever)

    })
  }
}
</script>
